import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Search from '../views/Search.vue'
import Cart from '../views/Cart.vue'
import Favorite from '../views/Favorite.vue'
import ItemDetail from '../views/ItemDetail.vue'
import History from '../views/History.vue'
import Order from '../views/Order.vue'
import Pay from '../views/Pay.vue'
import OrderDetail from '../views/OrderDetail.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    meta: {
      title: 'Index'
    }
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home,
    meta: {
      title: 'Home'
    }
  },
  {
    path: '/Login',
    component: Login,
    meta: {
      title: 'Login'
    }
  },
  {
    path: '/Register',
    component: Register,
    meta: {
      title: 'Register'
    }
  },
  {
    path: '/Search',
    name: 'Search',
    component: Search,
    meta: {
      title: 'Search'
    }
  },
  {
    path: '/Cart',
    name: 'Cart',
    component: Cart,
    meta: {
      title: 'Cart'
    }
  },
  {
    path: '/Favorite',
    component: Favorite
  },
  {
    path: '/ItemDetail',
    name: 'ItemDetail',
    component: ItemDetail,
    meta: {
      title: 'ItemDetail'
    }
  },
  {
    path: '/History',
    name: 'History',
    component: History,
    meta: {
      title: 'History'
    }
  },
  {
    path: '/Order',
    name: 'Order',
    component: Order,
    meta: {
      title: 'Order'
    }
  },
  {
    path: '/Pay',
    name: 'Pay',
    component: Pay,
    meta: {
      title: 'Pay'
    }
  },
  {
    path: '/OrderDetail',
    name: 'OrderDetail',
    component: OrderDetail,
    meta: {
      title: 'OrderDetail'
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
